# Copyright 2021 Ant Group Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("//bazel:psi.bzl", "psi_cc_binary")

package(default_visibility = ["//visibility:public"])

psi_cc_binary(
    name = "keyword_pir_setup",
    srcs = ["keyword_pir_setup.cc"],
    data = [
        "//examples/data:psi",
    ],
    linkopts = [
        "-lm",
    ],
    deps = [
        "//examples:utils",
        "@com_google_absl//absl/strings",
        "@psi//psi/pir",
        "@psi//psi/psi/core/labeled_psi",
        "@yacl//yacl/crypto/utils:rand",
    ],
)

psi_cc_binary(
    name = "keyword_pir_server",
    srcs = ["keyword_pir_server.cc"],
    data = [
        "//examples/data:psi",
    ],
    linkopts = [
        "-lm",
    ],
    deps = [
        "//examples:utils",
        "@com_google_absl//absl/strings",
        "@psi//psi/pir",
        "@psi//psi/psi/core/labeled_psi",
        "@psi//psi/psi/utils",
        "@psi//psi/psi/utils:serialize",
        "@yacl//yacl/crypto/utils:rand",
    ],
)

psi_cc_binary(
    name = "keyword_pir_mem_server",
    srcs = ["keyword_pir_mem_server.cc"],
    data = [
        "//examples/data:psi",
    ],
    linkopts = [
        "-lm",
    ],
    deps = [
        "//examples:utils",
        "@com_google_absl//absl/strings",
        "@psi//psi/pir",
        "@psi//psi/psi/core/labeled_psi",
        "@psi//psi/psi/utils",
        "@psi//psi/psi/utils:serialize",
        "@yacl//yacl/crypto/utils:rand",
    ],
)

psi_cc_binary(
    name = "keyword_pir_client",
    srcs = ["keyword_pir_client.cc"],
    data = [
        "//examples/data:psi",
    ],
    linkopts = [
        "-lm",
    ],
    deps = [
        "//examples:utils",
        "@com_google_absl//absl/strings",
        "@psi//psi/pir",
        "@psi//psi/psi/core/labeled_psi",
        "@psi//psi/psi/utils",
        "@psi//psi/psi/utils:serialize",
        "@yacl//yacl/crypto/utils:rand",
        "@yacl//yacl/io/rw:csv_writer",
    ],
)

psi_cc_binary(
    name = "generate_pir_data",
    srcs = ["generate_pir_data.cc"],
    deps = [
        "//examples:utils",
        "@com_google_absl//absl/strings",
        "@yacl//yacl/crypto/utils:rand",
    ],
)
